# 学习函数
# def

# def mypmax(number1,number2):
#     if number1 > number2 :
#         print('最大值：',number1)
#     else:
#         print('最大值：', number2)
#
# mypmax(1,3)

# 圣诞树练习
# n = int(input('请输入圣诞树数字:'))
# def mytree(n):
#     for line in range(1,n+1):
#         star = 2*line-1
#         enter = n - line
#         starshow = ' '*enter + '*'* star
#         print(starshow)
#     for line in range(1,n+1):
#         enter = n -1
#         show = ' '*enter + '$'
#         print(show)
# mytree(n)

# return 语句
# def myprint():
#     print('111')
#     print('222')
#     return
#     print('333')
#
# result = myprint()
# print('result:', result)
# def myadd(a,b):
#     return a+b
# a = int(input('输入数字1：'))
# b = int(input('输入数字1：'))
# n = myadd(a,b)
# print('数字和是：',n)
# def get_scores():
#     scores =[]
#     while True:
#         a_scores = int(input('请输入成绩：'))
#         if a_scores < 0:
#             return scores
#         scores.append(a_scores)
#
# def get_jige_scores():
#     jigescores = [jige for jige in scores if jige >= 60 ]
#     # jigescores = []
#     # for jige in scores :
#     #     if jige >= 60:
#     #         jigescores.append(jige)
#     return jigescores
# def get_bujige_scores():
#     bujigescores = []
#     for bujige in scores:
#         if bujige < 60:
#             bujigescores.append(bujige)
#     return bujigescores
# scores = get_scores()
# jigescores = get_jige_scores()
# bujigescores = get_bujige_scores()
# print('及格的成绩有：', jigescores)
# print('不及格的成绩有：', bujigescores)
# 函数的传参及调用
# 练习 计算两个数，三个数，四个数的和
# def myadd(a, b, c=0, d=0):
#     return a + b + c + d
#
#
# print(myadd(1, 2))
# print(myadd(1, 2, 3))
# print(myadd(1, 2, 3, 4))

# def mysum(*args):
#     s = 0
#     for n in  args:
#         s = n+s
#     return s
#
# print(mysum(1,2,3,4,5,5,5,5,5))

练习三角形
# def san(n):
#     if n % 2 != 0:
#         for s in range(1,4):
#
#          print('*'*s)
#
# print(san(5))

# def fn(n):
#    if == 1:
#        def f1():
#            print('f1被调用')
#    if == 1:
#        def f2():
#            print('f2被调用')
# print(x)
# print(y)
# n = int(input('请输入数字：'))
# def main(n):
#     if n == 1
#     def san1()
#         for line in range(1,n+1)
#             print('*'* n)
#     if n == 2
#     def san1()
#         for line in range(1,n+1)
#             line_count = line
#             blank_count = n-line_count
#             aline = ' '* n-line_count +'*'line_count
#             print(aline)
#
#     if n == 3
#     def san1()
#         for line in range(1,n+1)
#             print('*'* n)
#     if n == 4
#     def san1()
#         for line in range(1,n+1)
#             print('*'* n)




# global  global  global
# nonlabal
# v = [1, 2, 3, 4]
# def fn():
#     v = [5, 6, 7, 8]
# fn()
# print("v:",v)
# lambda
# s = lambda n: n**2% 5 ==0
# 冒泡排序 bubble_sort
# def bubble_sort(n):
#     s = list(n)
#     for m in range(len(s) - 1, 0, -1):
#         for i in range(m):
#             if s[i] > s[i + 1]:
#                 s[i], s[i + 1] = s[i + 1], s[i]
#     return s
#
#
# l1 = [9, 4, 6, 8, 19, 2]
# l2 = bubble_sort(l1)
# print('p排序前：', l1)
# print('p排序前：', l2)
#
#
# # binary search 二分查找
# def binary_search(data_list, value):
#     low = 0
#     hight = len(data_list) - 1
#     while low <= hight:
#         mind = (low + hight) // 2
#         if data_list[mind] == value:
#             return mind
#         elif value < data_list[mind]:
#             hight = mind - 1
#         elif value > data_list[mind]:
#             low = mind + 1
#     return -1
# l1 = [2, 4, 6, 8, 9, 19]
# print(binary_search(l1,6))
#
# #class
# class Car:
#     pass
